package com.l2jserver.gameserver.util.audit;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.logging.Level;
import java.util.logging.Logger;

import com.l2jserver.Config;
import com.l2jserver.util.lib.Log;

/**
 * Audits Community problems.
 */
public class CommunityAudit
{
	private static final Logger _log = Logger.getLogger(Log.class.getName());
	
	public static void auditCommunity(String msg)
	{
		final SimpleDateFormat _formatter = new SimpleDateFormat("dd/MM/yyyy H:mm:ss");
		final String date = _formatter.format(new Date());
		
		final File file = new File("log/community.txt");
		try (FileWriter save = new FileWriter(file, true))
		{
			save.write(date + ":\t" + msg + Config.EOL);
		}
		catch (IOException e)
		{
			_log.log(Level.SEVERE, "Community Audit could not be saved: ", e);
		}
	}
}